package com.gitee.gphomework.pattern.commandpattern.command;

import com.gitee.gphomework.pattern.commandpattern.receiver.FtpCmdReceiver;

import java.util.Objects;

/**
 * Created on 2020/3/17
 * Title: 告诉服务器监听的端口号
 * Description: 告诉 FTP 服务器客户端监听的端口号，让 FTP 服务器采用主动模式连接客户端
 * Copyright: Copyright(c) 2020
 * Company:
 *
 * @author yifeng
 */
public class PortCommand implements IFtpCommand {

    private FtpCmdReceiver ftpCmdReceiver;

    public PortCommand(FtpCmdReceiver ftpCmdReceiver) {
        Objects.requireNonNull(ftpCmdReceiver);
        this.ftpCmdReceiver = ftpCmdReceiver;
    }

    @Override
    public void execute() {
        ftpCmdReceiver.port();
    }
}
